﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Principal;
using System.Web.Security;

namespace CustomSiteMapProvider
{
    public class CustomXmlSiteMapProvider : XmlSiteMapProvider
    {

        //hrclerk/hrclerk
        //manager/manager
        //anowak/anowak
        public override bool IsAccessibleToUser(HttpContext context, SiteMapNode node)
        {

            if (context.User.Identity.IsAuthenticated && node.IsAccessibleToRoles( Roles.GetRolesForUser()))
            {
                return true;
            }
            else
            {
                return false;
            }
        }
     
    }
}